<!DOCTYPE html>
<html lang="en">

<head>
    <meta>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>Document</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="./js/store.legacy.min.js"></script>
</head>

<body>
    <button style="padding: 10px; margin: 10px;" id="clearLocal" onclick="store.clearAll()">清除缓存</button>
    <!-- <img width="100%" data-src='./images/1.jpg' src="./images/default.gif"> -->
    <img width="100%" data-src='./images/5.jpg' src="./images/default.gif">
    <img width="100%" data-src='./images/6.jpg' src="./images/default.gif">
    <img width="100%" data-src='./images/2.png' src="./images/default.gif">
    <img width="100%" data-src='./images/3.png' src="./images/default.gif">
    <img width="100%" data-src='./images/4.png' src="./images/default.gif">
    <img width="100%" data-src='./images/5.png' src="./images/default.gif">
    <img width="100%" data-src='./images/6.png' src="./images/default.gif">
    <img width="100%" data-src='./images/7.png' src="./images/default.gif">
    <img width="100%" data-src='./images/4.jpg' src="./images/default.gif">
    <script type="text/javascript">
    store.set('imgCache', {
        'a': 1,
        'b': 2
    });
    store.set('imgCache2', {
        'a': 11,
        'b': 22
    });
    store.set('imgCache3', {
        'a': 1111,
        'b': 2222
    });
    /**
     * [removeItem 删除指定本地数据]
     * @Author   zhanggongze
     * @DateTime 2017-06-03
     * @param    {[type]}    _name [存储名]
     * @param    {[type]}    _key  [数据的key]
     * @return   {[type]}          [description]
     */
    function removeItem(_name, _key) {
        store.each(function(value, key) {
            if (_name === key) {
                delete value[_key];
                store.set(_name, value);
            }
        });
        return store.get(_name);
    }
   var o = removeItem('imgCache3', 'b');
   console.log(o);
    </script>
</body>

</html>
